﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Models.Device;
using Models.JsonResultModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using UtilsBase;
using UtilsCache;
using ServiceWeb.DBGateway;

namespace ServiceWeb.APIRequest
{
    public class ServiceDeviceControlRemote
    {


        public bool senddatasql(string scode, string table, string content, string from)
        {
            //ModelRemoteManageControl deviceControl = new ModelRemoteManageControl();
            //deviceControl.guid = Guid.NewGuid().ToString();
            //deviceControl.serverCode = scode;
            //deviceControl.table = table;
            //deviceControl.content = content;
            //deviceControl.from = from;
            //deviceControl.commandName = EnumCommandName.remote_DataSqlRequest;
            //new ServiceWebRabbitMQSendMsg_UseMethod().sendDeviceControlCommand(deviceControl);
           // new UtilsHttpHelper().sendPostToGateWayCloodBridgeAPI(UtilAppsettingCache.getSetting("API:url_deviceControlRemote"), deviceControl);
            return true;
        }

        public bool sendDeviceCommand(string scode, string dguid, string key, string from, string commandCentent = "")
        {
            //ModelRemoteManageControl deviceControl = new ModelRemoteManageControl();
            //deviceControl.guid = Guid.NewGuid().ToString();
            //deviceControl.dguid = dguid;
            //deviceControl.key = key;
            //deviceControl.from = from;
            //deviceControl.commandName = EnumCommandName.remote_DeviceCommandRequest;
            //deviceControl.content = commandCentent;
            //deviceControl.serverCode = scode;
            //new ServiceWebRabbitMQSendMsg_UseMethod().sendDeviceControlCommand(deviceControl);
           // new UtilsHttpHelper().sendPostToGateWayCloodBridgeAPI(UtilAppsettingCache.getSetting("API:url_deviceControlRemote"), deviceControl);
            return true;
        }
    }
}
